////
////  PSTabBarController.m
////  UITabBar的不规则显示
////
////  Created by ibos on 15/12/28.
////  Copyright © 2015年 ibos. All rights reserved.
////
//
//#import "PSTabBarController.h"
//#import "PSNavigationVC.h"
//#import "PSTabBar.h"
//#define IsiOS7Later   ([[UIDevice currentDevice].systemVersion doubleValue] >= 7.0)
//
//@interface PSTabBarController ()
//@property (nonatomic,weak)PSFirstViewController * vc1;
//@property (nonatomic,weak)PSSecondViewController * vc2;
//@property (nonatomic,weak)PSThirdViewController * vc3;
//@property (nonatomic,weak)PSFourViewController * vc4;
//@property (nonatomic,weak)PSFiveViewController * vc5;
//@end
//
//@implementation PSTabBarController
//- (void)viewDidLoad
//{
//    [super viewDidLoad];
//    
//    [self addAllChildVCs];
//    [self addCustomTabBar];
//}
//
//- (void)addCustomTabBar
//{
//    // 创建自定义tabbar
//    
//    __weak typeof(self) ws = self;
//    PSTabBar *customTabBar = [[PSTabBar alloc] init];
//    customTabBar.block = ^()
//    {
//        ws.selectedIndex = 2;
//    };
//    [self setValue:customTabBar forKeyPath:@"tabBar"];
//}
//
//- (void)addAllChildVCs
//{
//    
//    PSFirstViewController * vc1 = [[PSFirstViewController alloc] init];
//    self.vc1 = vc1;
////    [self addChildVC:self.vc1 withTitle:@"第一" image:nil selectImage:nil];
//    [self addChildVC:self.vc1 withTitle:@"第一" withSystemItem:(UITabBarSystemItemContacts) tag:0];
//    
//    PSSecondViewController * vc2 = [[PSSecondViewController alloc] init];
//    self.vc2 = vc2;
////    [self addChildVC:self.vc2 withTitle:@"第二" image:nil selectImage:nil];
//    [self addChildVC:self.vc2 withTitle:@"第二" withSystemItem:(UITabBarSystemItemBookmarks) tag:1];
//
//    
//    PSThirdViewController * vc3 = [[PSThirdViewController alloc] init];
//    self.vc3 = vc3;
////    [self addChildVC:self.vc3 withTitle:@"第三" image:nil selectImage:nil ];
//    [self addChildVC:self.vc3 withTitle:@"第三" withSystemItem:(UITabBarSystemItemDownloads) tag:2];
//
//    
//    
//    PSFourViewController * vc4 =  [[PSFourViewController alloc] init];
//    self.vc4 = vc4;
////    [self addChildVC:self.vc4 withTitle:@"第四" image:nil selectImage:nil];
//    [self addChildVC:self.vc4 withTitle:@"第四" withSystemItem:(UITabBarSystemItemFavorites) tag:3];
//
//    
//    
//    PSFiveViewController * vc5 = [[PSFiveViewController alloc] init];
//    self.vc5 = vc5;
////    [self addChildVC:self.vc5 withTitle:@"第五" image:nil selectImage:nil ];
//    [self addChildVC:self.vc5 withTitle:@"第五" withSystemItem:(UITabBarSystemItemHistory) tag:4];
//
//}
//
//#pragma mark -添加一个子控制器-
//-(void)addChildVC:(UIViewController*)chiledrenVC withTitle:(NSString*)title image:(NSString*)image selectImage :(NSString*)selectImage
//{
//    
//    chiledrenVC.title = title;
//    UIImage * img = [UIImage imageNamed:image ];
//    UIImage * selectImg = [UIImage imageNamed:selectImage];
//    
//    if(IsiOS7Later)
//    {
//        img  =[img imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
//        selectImg = [selectImg imageWithRenderingMode:(UIImageRenderingModeAlwaysOriginal)];
//        
//    }
//    chiledrenVC.tabBarItem.image = img;
//    chiledrenVC.tabBarItem.selectedImage = selectImg;
//    PSNavigationVC * navi = [[PSNavigationVC alloc] initWithRootViewController:chiledrenVC];
//    [self addChildViewController:navi];
//}
//
//- (void)addChildVC:(UIViewController*)chiledrenVC withTitle:(NSString*)title withSystemItem:(UITabBarSystemItem)item tag:(NSInteger)tag
//{
//    chiledrenVC.title = title;
//    chiledrenVC.tabBarItem = [[UITabBarItem alloc] initWithTabBarSystemItem:item tag:tag];
//    PSNavigationVC * navi = [[PSNavigationVC alloc] initWithRootViewController:chiledrenVC];
//    [self addChildViewController:navi];
//
//}
//
//
//
//@end
